%close all; clear all;

%Y Target Variable
Y = csvread('Data\TesteSurfaceData\Y.csv');

%X rawdata training data set
X = csvread('Data\TesteSurfaceData\X.csv');

%feature scaling to avoid overflow
[X, mu, st] = featureScaling(X);

CZ = zeros(10,10);

 %P = featureParametersInitialization(500, 5, [1 10], [1 10]);

for l = 1:10
    
    %P(1,2) = l;
    
    for w=1:10
        %P(1,1) = w;
        
        P = [w l;3 1;6 2;2 6;7 5]; 
        %Ps = [6	3;3 1;6 2;2 6;7 5];
        %P = Ps;
        
        %calculate features F from X using random parameters P
        [FY, F] = featureProgram(Y, X, P);
        
        
        
        %find w parameters
        [W, wCost] = linearRegressionModel(F, FY, 400, 0.01, 1);
        
%         Ws =[16.574; 9.1826; 32.735; 14.418; 20.061; 29.907];
%         W = Ws;
        
        
        %calculate the cost
        [H, cost] = modelPrediction(Y ,X, P, W);
        
           
        CZ(l,w) = cost
        cost
    end;
end;